package sy.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
 * TsupplierOffer entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tsupplier_offer", schema = "")
@DynamicUpdate(true)
@DynamicInsert(true)
public class TsupplierOffer implements java.io.Serializable
{
    
    // Fields    
    
    private String offerid;
    
    private String arrive;
    
    private String description;
    
    private String price;
    
    private String start;
    
    private String vehicleid;
    
    private Set<TvehicleToffer> tofferTvehicles = new HashSet<TvehicleToffer>(0);
    
    // Constructors
    
    /** default constructor */
    public TsupplierOffer()
    {
    }
    
    /** minimal constructor */
    public TsupplierOffer(String offerid, String arrive, String price, String start, String vehicleid)
    {
        this.offerid = offerid;
        this.arrive = arrive;
        this.price = price;
        this.start = start;
        this.vehicleid = vehicleid;
    }
    
    /** full constructor */
    public TsupplierOffer(String offerid, String arrive, String description, String price, String start,
        String vehicleid, Set<TvehicleToffer> tofferTvehicles)
    {
        this.offerid = offerid;
        this.arrive = arrive;
        this.description = description;
        this.price = price;
        this.start = start;
        this.vehicleid = vehicleid;
        this.tofferTvehicles = tofferTvehicles;
    }
    
    // Property accessors
    @Id
    @Column(name = "offerid", unique = true, nullable = false)
    public String getOfferid()
    {
        return this.offerid;
    }
    
    public void setOfferid(String offerid)
    {
        this.offerid = offerid;
    }
    
    @Column(name = "arrive", nullable = false)
    public String getArrive()
    {
        return this.arrive;
    }
    
    public void setArrive(String arrive)
    {
        this.arrive = arrive;
    }
    
    @Column(name = "description")
    public String getDescription()
    {
        return this.description;
    }
    
    public void setDescription(String description)
    {
        this.description = description;
    }
    
    @Column(name = "price", nullable = false)
    public String getPrice()
    {
        return this.price;
    }
    
    public void setPrice(String price)
    {
        this.price = price;
    }
    
    @Column(name = "start", nullable = false)
    public String getStart()
    {
        return this.start;
    }
    
    public void setStart(String start)
    {
        this.start = start;
    }
    
    @Column(name = "vehicleid", nullable = false)
    public String getVehicleid()
    {
        return this.vehicleid;
    }
    
    public void setVehicleid(String vehicleid)
    {
        this.vehicleid = vehicleid;
    }
    
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "toffer")
    public Set<TvehicleToffer> getTofferTvehicles()
    {
        return this.tofferTvehicles;
    }
    
    public void setTofferTvehicles(Set<TvehicleToffer> tofferTvehicles)
    {
        this.tofferTvehicles = tofferTvehicles;
    }
    
}